import numpy as np
import sys

case_711300_0 = [
    16843266, 0, 0, 64, 1024, 1, 1, 0, 128, 0, 256, 0, 64, 0, 1, 3, 2048, 128,
    2048, 3, 2048, 64, 16, 512, 64, 1, 4, 1, 4, 0, 0, 0, 0, 0, 32768,
    0, 1, 1, 1, 1, 1, 1, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0
]

case_611210_0 = [
    260, 65537, 0, 0, 32, 128, 64, 0, 128, 0, 128, 0, 0, 0, 0, 0, 1, 128,
    128, 128, 128, 128, 32, 128, 128, 32, 128, 1, 1, 1, 1, 0, 0, 0, 0,
    20480, 16384, 0, 1, 1, 1, 1, 1, 1, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0
]

case_611210_1 = [
    275, 196609, 0, 0, 1, 4096, 1, 0, 4096, 0, 4096, 0, 0, 0, 0, 0, 1, 2,
    4096, 4096, 4096, 2, 224, 4096, 16, 224, 128, 32, 8, 1, 1, 0, 0, 1, 0,
    294912, 14336, 0, 1, 1, 1, 1, 32, 4, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0
]

case_311210_0 = [
    34078984, 0, 0, 0, 0, 512, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    64, 32, 1, 1, 0, 1, 0, 8, 0, 0, 0, 8, 0, 0, 0, 512, 0,
    256, 0, 512, 0, 256, 0, 0, 0, 128, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 128, 256, 512, 512, 64, 32, 512, 64, 32, 128, 4,
    4, 1, 1, 0, 16384, 0, 0, 98304, 8192, 0, 1, 1, 1, 1, 2, 2, 0, 0, 2, 2, 2, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
]

case_611200_0 = [
    276, 196609, 0, 0, 32, 2560, 64, 0, 2560, 0, 5120, 0, 0, 0, 0, 0, 1, 128,
    5120, 2560, 2560, 128, 256, 2560, 128, 256, 128, 20, 2, 1, 1, 0, 131072, 1, 0,
    393216, 131072, 0, 1, 1, 1, 1, 20, 1, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0
]

params_info = {
    "case_711300_0": case_711300_0,
    "case_611210_0": case_611210_0,
    "case_611210_1": case_611210_1,
    "case_311210_0": case_311210_0,
    "case_611200_0": case_611200_0,
}

def main():
    params_list = params_info[sys.argv[1]]  # python gen_tiling.py case0  sys.argv[1]="case0"
    base_params = np.array(params_list[:], dtype=np.int32)
    tiling_file = open("tiling.bin", "wb")
    base_params.tofile(tiling_file)

if __name__ == '__main__':
    main()
